//
//  ComposeTextView.swift
//  Status
//
//  Created by Kylin on 16/3/24.
//  Copyright © 2016年 Kylin. All rights reserved.
//

import UIKit
import SnapKit

class ComposeTextView: UITextView {
    // MARK:- 懒加载属性
    lazy var placeholderLabel : UILabel = UILabel()
    
    
    // 构造函数
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        
        setupUI()
    }

}

extension ComposeTextView {
    private func setupUI () {
        // 1:添加子控件
        addSubview(placeholderLabel)
        // 2:设置子控件的位置
        placeholderLabel.snp_makeConstraints { (make) -> Void in
            make.top.equalTo(8)
            make.leading.equalTo(10)
            
        }
       // 3:设置属性
        placeholderLabel.font = font
        placeholderLabel.textColor = UIColor.lightGrayColor()
        placeholderLabel.text = "分享新鲜事..."
        
        textContainerInset = UIEdgeInsets(top: 8, left: 7, bottom: 0, right: 7)
    }
}